如何停止一个在后台运行的PHP脚本

您所在的位置:网站首页 linux 启动脚本 sleep不起作用 如何停止一个在后台运行的PHP脚本

如何停止一个在后台运行的PHP脚本

2023-05-01 16:41| 来源: 网络整理| 查看: 265

百度翻译此文   有道翻译此文 问题描述

I started this process (time.php)

but I now want to stop it. It's sending hundreds of mail to my Gmail a/c. It's on a web server where I cant restart it to kill the process.

Is there a way to execute another file to kill the process, or how do I go about?

推荐答案

If you don't have shell access, then the only way is to ask the server administrater to kill the process.

That being said, there is an easy way to set up a script and enable it to be canceled from any other script on the same server, as follows:

其他推荐答案

I am assuming you do not have shell access either. I suspect the easiest way is to contact the administrator and have them restart Apache. They don't want this running anymore than you do.

One alternative would to attempt to kill all the Apache processes using PHP. It will send a kill signal to all Apache processes, except the one it is running under. This might work if the Apache process running under a shared process without setuid(). Attempt at your own risk.

其他推荐答案

The following will stop the background process(PHP):

sudo service apache2 stop

To start apache again:

sudo service apache2 start

To simply re-start apache:

sudo service apache2 start


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3